package com.workstudy.wstudy.service.impl;

import java.util.List;
import com.workstudy.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.workstudy.wstudy.mapper.WstPostFinishedMapper;
import com.workstudy.wstudy.domain.WstPostFinished;
import com.workstudy.wstudy.service.IWstPostFinishedService;
import com.workstudy.common.core.text.Convert;

/**
 * 往期岗位Service业务层处理
 * 
 * @author sun
 * @date 2021-04-07
 */
@Service
public class WstPostFinishedServiceImpl implements IWstPostFinishedService 
{
    @Autowired
    private WstPostFinishedMapper wstPostFinishedMapper;

    /**
     * 查询往期岗位
     * 
     * @param postId 往期岗位ID
     * @return 往期岗位
     */
    @Override
    public WstPostFinished selectWstPostFinishedById(Long postId)
    {
        return wstPostFinishedMapper.selectWstPostFinishedById(postId);
    }

    /**
     * 查询往期岗位列表
     * 
     * @param wstPostFinished 往期岗位
     * @return 往期岗位
     */
    @Override
    public List<WstPostFinished> selectWstPostFinishedList(WstPostFinished wstPostFinished)
    {
        return wstPostFinishedMapper.selectWstPostFinishedList(wstPostFinished);
    }

    /**
     * 新增往期岗位
     * 
     * @param wstPostFinished 往期岗位
     * @return 结果
     */
    @Override
    public int insertWstPostFinished(WstPostFinished wstPostFinished)
    {
        wstPostFinished.setCreateTime(DateUtils.getNowDate());
        return wstPostFinishedMapper.insertWstPostFinished(wstPostFinished);
    }

    /**
     * 修改往期岗位
     * 
     * @param wstPostFinished 往期岗位
     * @return 结果
     */
    @Override
    public int updateWstPostFinished(WstPostFinished wstPostFinished)
    {
        wstPostFinished.setUpdateTime(DateUtils.getNowDate());
        return wstPostFinishedMapper.updateWstPostFinished(wstPostFinished);
    }

    /**
     * 删除往期岗位对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteWstPostFinishedByIds(String ids)
    {
        return wstPostFinishedMapper.deleteWstPostFinishedByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除往期岗位信息
     * 
     * @param postId 往期岗位ID
     * @return 结果
     */
    @Override
    public int deleteWstPostFinishedById(Long postId)
    {
        return wstPostFinishedMapper.deleteWstPostFinishedById(postId);
    }
}
